/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package qlvbdq.controler;

import javax.swing.JOptionPane;
import qlvbdq.bo.CTPhieuBanHangBO;
import qlvbdq.dto.CTPhieuBanHangDTO;

/**
 *
 * @author THAI HA
 */
public class CTPhieuBanHangControler {

    public CTPhieuBanHangControler() {
    }

    public boolean insertCTPhieuBanHang(CTPhieuBanHangDTO ctpbhdto_) {
        CTPhieuBanHangBO ctpbhbo = new CTPhieuBanHangBO();
        if (ctpbhbo.insertCTPhieuBanHang(ctpbhdto_)) {
            return true;
        } else {
            JOptionPane.showMessageDialog(null,
                    "Không thể thêm chi tiết phiếu bán hàng",
                    "Error",
                    JOptionPane.ERROR_MESSAGE);
            return false;
        }
    }
    
    public boolean deleteCTPhieuBanHang(CTPhieuBanHangDTO ctpbhdto_){
        CTPhieuBanHangBO ctpbhbo= new CTPhieuBanHangBO();
        if (ctpbhbo.deleteCTPhieuBanHang(ctpbhdto_)){
            return true;
        }else{
            JOptionPane.showMessageDialog(null,
                    "Không thể xóa chi tiết phiếu bán hàng",
                    "Error",
                    JOptionPane.ERROR_MESSAGE);
            return false;
        }
    }
}
